"""
    @author yu_chen
    @date  
    @todo 
"""
import urllib

import requests
from lxml import etree

headers = {
    'Referer': 'http://music.163.com/',
    'Host': 'music.163.com',
    'Accept-Language': "zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3",
    'Accept-Encoding': "gzip, deflate",
    'Content-Type': "application/x-www-form-urlencoded",
    'Origin': 'https://music.163.com',
    'Connection': "keep-alive",
    'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36'
                  ' (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36'
}
url = "http://music.163.com/song/media/outer/url?id=1396162013.mp3"
try:
    print('正在下载')
    urllib.request.urlretrieve(url, 'aa.mp3')
    print('下载成功')
except:
    print('下载失败')
